+2000-11-23 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkselection-fb.c:
+ Initial selection implementation.
+
+ * gtk/gtkselection.c:
+ if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
+ requestor in gtk_selection_request.
+
+ * gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
+ Added gdk_selection_property atom.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export _gdk_selection_window_destroyed.
+ Removed mask_off_x/y from GdkCursorPrivateFB.
+ Removed hbearing, added top, left to PangoFBGlyphInfo.
+
+ * gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
+ Call _gdk_selection_window_destroyed
+ (_gdk_windowing_window_init): Don't call gdk_cursor_new() before
+ the root window has been created.
+ (static_dx_hack, static_dy_hack, compare_draw_rects,
+ gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
+ in region. They are already sorted. Instead just traverse them in
+ reverse if draw_direction < 0.
+
+ * gdk/linux-fb/gdkinput-ps2.c (send_button_event):
+ Double-clicks must be sent after the normal button_press.
+ (gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
+
+ * gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
+ Pass _gdk_fb_screen_gc instead of NULL.
+
+ * gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
+ Initialize gdk_selection_property.
+ (gdk_event_make): Remove unused code.
+
+ * gdk/linux-fb/gdkcursor-fb.c:
+ Make the pixmap for the cursor the same size as the mask. Also remove
+ the mask_off_x/y fields in GdkCursorPrivateFB and combine
+ _gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
+ Now the whole cursor is visible.
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
+ Fix bug where xdest+height instead of ydest+height was used
+ to calculate if the source and dest overlapped. This fixes the
+ redraw bug when the main window in testgtk was scrolled when
+ partially covered by a tall window.
+ Copy rectangles in region in order depending on draw_direction.
+ Also moved the draw_direction flipping of start_y and end_y into
+ the gc functions, as this might not be what all of them want.
+ (gdk_fb_draw_lines): Support dashed lines.
+ (gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
+ so that the text is positioned correctly (was 1 pixel high).
+
+ gdk/linux-fb/gdkgc-fb.c:
+ Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
+ all lines were drawn a pixel to short. Also checked the default of
+ the rest of the values, and they're the same as X now.
+
+ * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
+ Clean up pixel positioning of the glyphs. Just use bgy->top and
+ bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
+ to all divisions to get correct rounding behaviour.
+
+ * gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
+ gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
+ Moved start_y/end_y flip into draw_drawable implementations.
+ Flip also x rendering when draw_direction < 0.
+ Remove unneccesary multiply with draw_direction.
+
Wed Nov 22 14:11:19 GMT 2000 Tony Gale <gale@gtk.org>
* docs/tutorial/gtk-tut.sgml:
+2000-11-23 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkselection-fb.c:
+ Initial selection implementation.
+
+ * gtk/gtkselection.c:
+ if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
+ requestor in gtk_selection_request.
+
+ * gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
+ Added gdk_selection_property atom.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export _gdk_selection_window_destroyed.
+ Removed mask_off_x/y from GdkCursorPrivateFB.
+ Removed hbearing, added top, left to PangoFBGlyphInfo.
+
+ * gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
+ Call _gdk_selection_window_destroyed
+ (_gdk_windowing_window_init): Don't call gdk_cursor_new() before
+ the root window has been created.
+ (static_dx_hack, static_dy_hack, compare_draw_rects,
+ gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
+ in region. They are already sorted. Instead just traverse them in
+ reverse if draw_direction < 0.
+
+ * gdk/linux-fb/gdkinput-ps2.c (send_button_event):
+ Double-clicks must be sent after the normal button_press.
+ (gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
+
+ * gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
+ Pass _gdk_fb_screen_gc instead of NULL.
+
+ * gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
+ Initialize gdk_selection_property.
+ (gdk_event_make): Remove unused code.
+
+ * gdk/linux-fb/gdkcursor-fb.c:
+ Make the pixmap for the cursor the same size as the mask. Also remove
+ the mask_off_x/y fields in GdkCursorPrivateFB and combine
+ _gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
+ Now the whole cursor is visible.
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
+ Fix bug where xdest+height instead of ydest+height was used
+ to calculate if the source and dest overlapped. This fixes the
+ redraw bug when the main window in testgtk was scrolled when
+ partially covered by a tall window.
+ Copy rectangles in region in order depending on draw_direction.
+ Also moved the draw_direction flipping of start_y and end_y into
+ the gc functions, as this might not be what all of them want.
+ (gdk_fb_draw_lines): Support dashed lines.
+ (gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
+ so that the text is positioned correctly (was 1 pixel high).
+
+ gdk/linux-fb/gdkgc-fb.c:
+ Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
+ all lines were drawn a pixel to short. Also checked the default of
+ the rest of the values, and they're the same as X now.
+
+ * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
+ Clean up pixel positioning of the glyphs. Just use bgy->top and
+ bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
+ to all divisions to get correct rounding behaviour.
+
+ * gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
+ gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
+ Moved start_y/end_y flip into draw_drawable implementations.
+ Flip also x rendering when draw_direction < 0.
+ Remove unneccesary multiply with draw_direction.
+
Wed Nov 22 14:11:19 GMT 2000 Tony Gale <gale@gtk.org>
* docs/tutorial/gtk-tut.sgml:
+2000-11-23 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkselection-fb.c:
+ Initial selection implementation.
+
+ * gtk/gtkselection.c:
+ if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
+ requestor in gtk_selection_request.
+
+ * gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
+ Added gdk_selection_property atom.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export _gdk_selection_window_destroyed.
+ Removed mask_off_x/y from GdkCursorPrivateFB.
+ Removed hbearing, added top, left to PangoFBGlyphInfo.
+
+ * gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
+ Call _gdk_selection_window_destroyed
+ (_gdk_windowing_window_init): Don't call gdk_cursor_new() before
+ the root window has been created.
+ (static_dx_hack, static_dy_hack, compare_draw_rects,
+ gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
+ in region. They are already sorted. Instead just traverse them in
+ reverse if draw_direction < 0.
+
+ * gdk/linux-fb/gdkinput-ps2.c (send_button_event):
+ Double-clicks must be sent after the normal button_press.
+ (gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
+
+ * gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
+ Pass _gdk_fb_screen_gc instead of NULL.
+
+ * gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
+ Initialize gdk_selection_property.
+ (gdk_event_make): Remove unused code.
+
+ * gdk/linux-fb/gdkcursor-fb.c:
+ Make the pixmap for the cursor the same size as the mask. Also remove
+ the mask_off_x/y fields in GdkCursorPrivateFB and combine
+ _gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
+ Now the whole cursor is visible.
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
+ Fix bug where xdest+height instead of ydest+height was used
+ to calculate if the source and dest overlapped. This fixes the
+ redraw bug when the main window in testgtk was scrolled when
+ partially covered by a tall window.
+ Copy rectangles in region in order depending on draw_direction.
+ Also moved the draw_direction flipping of start_y and end_y into
+ the gc functions, as this might not be what all of them want.
+ (gdk_fb_draw_lines): Support dashed lines.
+ (gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
+ so that the text is positioned correctly (was 1 pixel high).
+
+ gdk/linux-fb/gdkgc-fb.c:
+ Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
+ all lines were drawn a pixel to short. Also checked the default of
+ the rest of the values, and they're the same as X now.
+
+ * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
+ Clean up pixel positioning of the glyphs. Just use bgy->top and
+ bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
+ to all divisions to get correct rounding behaviour.
+
+ * gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
+ gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
+ Moved start_y/end_y flip into draw_drawable implementations.
+ Flip also x rendering when draw_direction < 0.
+ Remove unneccesary multiply with draw_direction.
+
Wed Nov 22 14:11:19 GMT 2000 Tony Gale <gale@gtk.org>
* docs/tutorial/gtk-tut.sgml:
+2000-11-23 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkselection-fb.c:
+ Initial selection implementation.
+
+ * gtk/gtkselection.c:
+ if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
+ requestor in gtk_selection_request.
+
+ * gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
+ Added gdk_selection_property atom.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export _gdk_selection_window_destroyed.
+ Removed mask_off_x/y from GdkCursorPrivateFB.
+ Removed hbearing, added top, left to PangoFBGlyphInfo.
+
+ * gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
+ Call _gdk_selection_window_destroyed
+ (_gdk_windowing_window_init): Don't call gdk_cursor_new() before
+ the root window has been created.
+ (static_dx_hack, static_dy_hack, compare_draw_rects,
+ gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
+ in region. They are already sorted. Instead just traverse them in
+ reverse if draw_direction < 0.
+
+ * gdk/linux-fb/gdkinput-ps2.c (send_button_event):
+ Double-clicks must be sent after the normal button_press.
+ (gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
+
+ * gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
+ Pass _gdk_fb_screen_gc instead of NULL.
+
+ * gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
+ Initialize gdk_selection_property.
+ (gdk_event_make): Remove unused code.
+
+ * gdk/linux-fb/gdkcursor-fb.c:
+ Make the pixmap for the cursor the same size as the mask. Also remove
+ the mask_off_x/y fields in GdkCursorPrivateFB and combine
+ _gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
+ Now the whole cursor is visible.
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
+ Fix bug where xdest+height instead of ydest+height was used
+ to calculate if the source and dest overlapped. This fixes the
+ redraw bug when the main window in testgtk was scrolled when
+ partially covered by a tall window.
+ Copy rectangles in region in order depending on draw_direction.
+ Also moved the draw_direction flipping of start_y and end_y into
+ the gc functions, as this might not be what all of them want.
+ (gdk_fb_draw_lines): Support dashed lines.
+ (gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
+ so that the text is positioned correctly (was 1 pixel high).
+
+ gdk/linux-fb/gdkgc-fb.c:
+ Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
+ all lines were drawn a pixel to short. Also checked the default of
+ the rest of the values, and they're the same as X now.
+
+ * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
+ Clean up pixel positioning of the glyphs. Just use bgy->top and
+ bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
+ to all divisions to get correct rounding behaviour.
+
+ * gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
+ gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
+ Moved start_y/end_y flip into draw_drawable implementations.
+ Flip also x rendering when draw_direction < 0.
+ Remove unneccesary multiply with draw_direction.
+
Wed Nov 22 14:11:19 GMT 2000 Tony Gale <gale@gtk.org>
* docs/tutorial/gtk-tut.sgml:
+2000-11-23 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkselection-fb.c:
+ Initial selection implementation.
+
+ * gtk/gtkselection.c:
+ if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
+ requestor in gtk_selection_request.
+
+ * gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
+ Added gdk_selection_property atom.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export _gdk_selection_window_destroyed.
+ Removed mask_off_x/y from GdkCursorPrivateFB.
+ Removed hbearing, added top, left to PangoFBGlyphInfo.
+
+ * gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
+ Call _gdk_selection_window_destroyed
+ (_gdk_windowing_window_init): Don't call gdk_cursor_new() before
+ the root window has been created.
+ (static_dx_hack, static_dy_hack, compare_draw_rects,
+ gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
+ in region. They are already sorted. Instead just traverse them in
+ reverse if draw_direction < 0.
+
+ * gdk/linux-fb/gdkinput-ps2.c (send_button_event):
+ Double-clicks must be sent after the normal button_press.
+ (gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
+
+ * gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
+ Pass _gdk_fb_screen_gc instead of NULL.
+
+ * gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
+ Initialize gdk_selection_property.
+ (gdk_event_make): Remove unused code.
+
+ * gdk/linux-fb/gdkcursor-fb.c:
+ Make the pixmap for the cursor the same size as the mask. Also remove
+ the mask_off_x/y fields in GdkCursorPrivateFB and combine
+ _gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
+ Now the whole cursor is visible.
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
+ Fix bug where xdest+height instead of ydest+height was used
+ to calculate if the source and dest overlapped. This fixes the
+ redraw bug when the main window in testgtk was scrolled when
+ partially covered by a tall window.
+ Copy rectangles in region in order depending on draw_direction.
+ Also moved the draw_direction flipping of start_y and end_y into
+ the gc functions, as this might not be what all of them want.
+ (gdk_fb_draw_lines): Support dashed lines.
+ (gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
+ so that the text is positioned correctly (was 1 pixel high).
+
+ gdk/linux-fb/gdkgc-fb.c:
+ Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
+ all lines were drawn a pixel to short. Also checked the default of
+ the rest of the values, and they're the same as X now.
+
+ * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
+ Clean up pixel positioning of the glyphs. Just use bgy->top and
+ bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
+ to all divisions to get correct rounding behaviour.
+
+ * gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
+ gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
+ Moved start_y/end_y flip into draw_drawable implementations.
+ Flip also x rendering when draw_direction < 0.
+ Remove unneccesary multiply with draw_direction.
+
Wed Nov 22 14:11:19 GMT 2000 Tony Gale <gale@gtk.org>
* docs/tutorial/gtk-tut.sgml:
+2000-11-23 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkselection-fb.c:
+ Initial selection implementation.
+
+ * gtk/gtkselection.c:
+ if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
+ requestor in gtk_selection_request.
+
+ * gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
+ Added gdk_selection_property atom.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export _gdk_selection_window_destroyed.
+ Removed mask_off_x/y from GdkCursorPrivateFB.
+ Removed hbearing, added top, left to PangoFBGlyphInfo.
+
+ * gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
+ Call _gdk_selection_window_destroyed
+ (_gdk_windowing_window_init): Don't call gdk_cursor_new() before
+ the root window has been created.
+ (static_dx_hack, static_dy_hack, compare_draw_rects,
+ gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
+ in region. They are already sorted. Instead just traverse them in
+ reverse if draw_direction < 0.
+
+ * gdk/linux-fb/gdkinput-ps2.c (send_button_event):
+ Double-clicks must be sent after the normal button_press.
+ (gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
+
+ * gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
+ Pass _gdk_fb_screen_gc instead of NULL.
+
+ * gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
+ Initialize gdk_selection_property.
+ (gdk_event_make): Remove unused code.
+
+ * gdk/linux-fb/gdkcursor-fb.c:
+ Make the pixmap for the cursor the same size as the mask. Also remove
+ the mask_off_x/y fields in GdkCursorPrivateFB and combine
+ _gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
+ Now the whole cursor is visible.
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
+ Fix bug where xdest+height instead of ydest+height was used
+ to calculate if the source and dest overlapped. This fixes the
+ redraw bug when the main window in testgtk was scrolled when
+ partially covered by a tall window.
+ Copy rectangles in region in order depending on draw_direction.
+ Also moved the draw_direction flipping of start_y and end_y into
+ the gc functions, as this might not be what all of them want.
+ (gdk_fb_draw_lines): Support dashed lines.
+ (gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
+ so that the text is positioned correctly (was 1 pixel high).
+
+ gdk/linux-fb/gdkgc-fb.c:
+ Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
+ all lines were drawn a pixel to short. Also checked the default of
+ the rest of the values, and they're the same as X now.
+
+ * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
+ Clean up pixel positioning of the glyphs. Just use bgy->top and
+ bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
+ to all divisions to get correct rounding behaviour.
+
+ * gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
+ gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
+ Moved start_y/end_y flip into draw_drawable implementations.
+ Flip also x rendering when draw_direction < 0.
+ Remove unneccesary multiply with draw_direction.
+
Wed Nov 22 14:11:19 GMT 2000 Tony Gale <gale@gtk.org>
* docs/tutorial/gtk-tut.sgml:
+2000-11-23 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkselection-fb.c:
+ Initial selection implementation.
+
+ * gtk/gtkselection.c:
+ if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
+ requestor in gtk_selection_request.
+
+ * gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
+ Added gdk_selection_property atom.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export _gdk_selection_window_destroyed.
+ Removed mask_off_x/y from GdkCursorPrivateFB.
+ Removed hbearing, added top, left to PangoFBGlyphInfo.
+
+ * gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
+ Call _gdk_selection_window_destroyed
+ (_gdk_windowing_window_init): Don't call gdk_cursor_new() before
+ the root window has been created.
+ (static_dx_hack, static_dy_hack, compare_draw_rects,
+ gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
+ in region. They are already sorted. Instead just traverse them in
+ reverse if draw_direction < 0.
+
+ * gdk/linux-fb/gdkinput-ps2.c (send_button_event):
+ Double-clicks must be sent after the normal button_press.
+ (gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
+
+ * gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
+ Pass _gdk_fb_screen_gc instead of NULL.
+
+ * gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
+ Initialize gdk_selection_property.
+ (gdk_event_make): Remove unused code.
+
+ * gdk/linux-fb/gdkcursor-fb.c:
+ Make the pixmap for the cursor the same size as the mask. Also remove
+ the mask_off_x/y fields in GdkCursorPrivateFB and combine
+ _gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
+ Now the whole cursor is visible.
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
+ Fix bug where xdest+height instead of ydest+height was used
+ to calculate if the source and dest overlapped. This fixes the
+ redraw bug when the main window in testgtk was scrolled when
+ partially covered by a tall window.
+ Copy rectangles in region in order depending on draw_direction.
+ Also moved the draw_direction flipping of start_y and end_y into
+ the gc functions, as this might not be what all of them want.
+ (gdk_fb_draw_lines): Support dashed lines.
+ (gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
+ so that the text is positioned correctly (was 1 pixel high).
+
+ gdk/linux-fb/gdkgc-fb.c:
+ Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
+ all lines were drawn a pixel to short. Also checked the default of
+ the rest of the values, and they're the same as X now.
+
+ * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
+ Clean up pixel positioning of the glyphs. Just use bgy->top and
+ bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
+ to all divisions to get correct rounding behaviour.
+
+ * gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
+ gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
+ Moved start_y/end_y flip into draw_drawable implementations.
+ Flip also x rendering when draw_direction < 0.
+ Remove unneccesary multiply with draw_direction.
+
Wed Nov 22 14:11:19 GMT 2000 Tony Gale <gale@gtk.org>
* docs/tutorial/gtk-tut.sgml:
{xterm_mask_bits, xterm_mask_width, xterm_mask_height, xterm_mask_x_hot, xterm_mask_y_hot}
};
-static GdkCursor *
-_gdk_cursor_new_from_pixmap (GdkPixmap *source,
- GdkPixmap *mask,
- GdkColor *fg,
- GdkColor *bg,
- gint x,
- gint y,
- gint mask_off_x,
- gint mask_off_y)
-{
- GdkCursorPrivateFB *private;
- GdkCursor *cursor;
-
- g_return_val_if_fail (source != NULL, NULL);
-
- private = g_new (GdkCursorPrivateFB, 1);
- cursor = (GdkCursor *) private;
- cursor->type = GDK_CURSOR_IS_PIXMAP;
- cursor->ref_count = 1;
- private->cursor = gdk_pixmap_ref (source);
- private->mask = gdk_pixmap_ref (mask);
- private->hot_x = x;
- private->hot_y = y;
- private->mask_off_x = mask_off_x;
- private->mask_off_y = mask_off_y;
-
- return cursor;
-}
-
GdkCursor*
gdk_cursor_new (GdkCursorType cursor_type)
{
- GdkPixmap *pm, *mask;
+ GdkPixmap *tmp_pm, *pm, *mask;
if (cursor_type >= sizeof(stock_cursors)/sizeof(stock_cursors[0]))
return NULL;
pm = stock_cursors[cursor_type].pm;
if (!pm)
{
- pm = stock_cursors[cursor_type].pm = gdk_bitmap_create_from_data (gdk_parent_root,
- stock_cursors[cursor_type].bits,
- stock_cursors[cursor_type].width,
- stock_cursors[cursor_type].height);
+ GdkGC *copy_gc;
+ char *data;
+ tmp_pm = gdk_bitmap_create_from_data (gdk_parent_root,
+ stock_cursors[cursor_type].bits,
+ stock_cursors[cursor_type].width,
+ stock_cursors[cursor_type].height);
+
+ data = g_malloc0 (((stock_cursors[cursor_type+1].width+7)/8) * stock_cursors[cursor_type+1].height);
+ pm = gdk_bitmap_create_from_data (gdk_parent_root,
+ data,
+ stock_cursors[cursor_type+1].width,
+ stock_cursors[cursor_type+1].height);
+ copy_gc = gdk_gc_new (pm);
+ gdk_draw_drawable(pm,
+ copy_gc,
+ tmp_pm,
+ 0, 0,
+ stock_cursors[cursor_type+1].hotx - stock_cursors[cursor_type].hotx,
+ stock_cursors[cursor_type+1].hoty - stock_cursors[cursor_type].hoty,
+ stock_cursors[cursor_type].width,
+ stock_cursors[cursor_type].height);
+ gdk_pixmap_unref (tmp_pm);
+ g_free (data);
+ gdk_gc_unref (copy_gc);
+
+ stock_cursors[cursor_type].pm = pm;
gdk_pixmap_ref (pm);
}
gdk_pixmap_ref (mask);
}
- return _gdk_cursor_new_from_pixmap (pm, mask, NULL, NULL,
- stock_cursors[cursor_type].hotx,
- stock_cursors[cursor_type].hoty,
- (stock_cursors[cursor_type].hotx - stock_cursors[cursor_type+1].hotx) * 1,
- (stock_cursors[cursor_type].hoty - stock_cursors[cursor_type+1].hoty) * 1);
+
+ return gdk_cursor_new_from_pixmap (pm, mask, NULL, NULL,
+ stock_cursors[cursor_type+1].hotx,
+ stock_cursors[cursor_type+1].hoty);
}
GdkCursor*
gint x,
gint y)
{
- return _gdk_cursor_new_from_pixmap (source, mask, fg, bg, x, y, 0, 0);
+ GdkCursorPrivateFB *private;
+ GdkCursor *cursor;
+
+ g_return_val_if_fail (source != NULL, NULL);
+
+ private = g_new (GdkCursorPrivateFB, 1);
+ cursor = (GdkCursor *) private;
+ cursor->type = GDK_CURSOR_IS_PIXMAP;
+ cursor->ref_count = 1;
+ private->cursor = gdk_pixmap_ref (source);
+ private->mask = gdk_pixmap_ref (mask);
+ private->hot_x = x;
+ private->hot_y = y;
+
+ return cursor;
}
void
destb.x1 = xdest;
destb.y1 = ydest;
destb.x2 = xdest + width;
- destb.y2 = xdest + height;
+ destb.y2 = ydest + height;
- if (EXTENTCHECK (&srcb, &destb) && ydest > ysrc)
+ if (EXTENTCHECK (&srcb, &destb) && ((ydest > ysrc) || ((ydest == ysrc) && (xdest > xsrc))))
draw_direction = -1;
}
src_x_off = (src_private->abs_x + xsrc) - (private->abs_x + xdest);
src_y_off = (src_private->abs_y + ysrc) - (private->abs_y + ydest);
- for(i = 0; i < real_clip_region->numRects; i++)
+ for (i = (draw_direction>0)?0:real_clip_region->numRects-1; i >= 0 && i < real_clip_region->numRects; i+=draw_direction)
{
GdkRegionBox *cur = &real_clip_region->rects[i];
- int start_y, end_y;
-
- if (draw_direction > 0)
- {
- start_y = cur->y1;
- end_y = cur->y2;
- }
- else
- {
- start_y = cur->y2 - 1;
- end_y = cur->y1 - 1;
- }
(*draw_func) (drawable,
gc,
src,
dc,
- start_y,
- end_y,
+ cur->y1,
+ cur->y2,
cur->x1,
cur->x2,
src_x_off,
GdkPoint *points,
gint npoints)
{
- if (GDK_GC_FBDATA (gc)->values.line_width > 0)
- miWideLine (drawable, gc, 0, npoints, points);
+ GdkGCFBData *private;
+
+ private = GDK_GC_FBDATA (gc);
+ if (private->values.line_width > 0)
+ {
+ if (private->dash_list)
+ miWideDash (drawable, gc, 0, npoints, points);
+ else
+ miWideLine (drawable, gc, 0, npoints, points);
+ }
else
- miZeroLine (drawable, gc, 0, npoints, points);
+ {
+ if (private->dash_list)
+ miZeroDashLine (drawable, gc, 0, npoints, points);
+ else
+ miZeroLine (drawable, gc, 0, npoints, points);
+ }
}
static void
pts[0].y = segs[i].y1;
pts[1].x = segs[i].x2;
pts[1].y = segs[i].y2;
-
+
gdk_fb_draw_lines (drawable, gc, pts, 2);
}
}
/* Fake its existence as a pixmap */
pango_fb_font_set_size (font);
-
+
for (i = xpos = 0; i < glyphs->num_glyphs; i++)
{
PangoFBGlyphInfo *pgi;
- int this_wid;
pgi = pango_fb_font_get_glyph_info (font, glyphs->glyphs[i].glyph);
- this_wid = (xpos + glyphs->glyphs[i].geometry.width)/PANGO_SCALE;
gdk_fb_draw_drawable_3 (drawable, gc, (GdkPixmap *)&pgi->fbd,
&fbdc,
0, 0,
- x + (xpos + glyphs->glyphs[i].geometry.x_offset)/PANGO_SCALE,
- y + glyphs->glyphs[i].geometry.y_offset / PANGO_SCALE
- + pgi->hbearing,
- this_wid, pgi->fbd.drawable_data.height);
+ x + PANGO_PIXELS (xpos) + pgi->left , y - pgi->top + 1,
+ pgi->fbd.drawable_data.width, pgi->fbd.drawable_data.height);
xpos += glyphs->glyphs[i].geometry.width;
}
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) (xid))
#define gdk_font_lookup(xid) ((GdkFont*) (xid))
+extern GdkAtom gdk_selection_property;
#endif /* GDKFB_H */
gdk_fb_gc_set_values (gc, values, values_mask);
+ private->values.cap_style = GDK_CAP_BUTT;
return gc;
}
gdk_region_destroy (tmp_region);
gdk_fb_draw_drawable_2 (GDK_DRAWABLE_IMPL(window),
- NULL,
+ _gdk_fb_screen_gc,
GDK_DRAWABLE_IMPL(window),
dest_rect.x - dx,
dest_rect.y - dy,
GdkFBDisplay *gdk_display = NULL;
GdkCursor *_gdk_fb_pointer_grab_cursor;
GdkGC *_gdk_fb_screen_gc = NULL;
+GdkAtom gdk_selection_property;
}
#endif
+ gdk_event_queue_append (event);
+
/* For double-clicks */
if (press_event)
gdk_event_button_generate (event);
- gdk_event_queue_append (event);
}
static GdkPixmap *last_contents = NULL;
gdk_fb_cursor_unhide()
{
GdkFBDrawingContext *mydc = gdk_fb_cursor_dc;
-
+ GdkCursorPrivateFB *last_private;
+ GdkDrawableFBData *pixmap_last;
+
+ last_private = GDK_CURSOR_FB (last_cursor);
+ pixmap_last = GDK_DRAWABLE_IMPL_FBDATA (last_private->cursor);
cursor_visibility_count++;
g_assert (cursor_visibility_count <= 1);
if (cursor_visibility_count < 1)
if (last_cursor)
{
if (!last_contents ||
- GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->width > GDK_DRAWABLE_IMPL_FBDATA (last_contents)->width ||
- GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->height > GDK_DRAWABLE_IMPL_FBDATA (last_contents)->height)
+ pixmap_last->width > GDK_DRAWABLE_IMPL_FBDATA (last_contents)->width ||
+ pixmap_last->height > GDK_DRAWABLE_IMPL_FBDATA (last_contents)->height)
{
if (last_contents)
gdk_pixmap_unref (last_contents);
last_contents = gdk_pixmap_new (gdk_parent_root,
- GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->width,
- GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->height,
+ pixmap_last->width,
+ pixmap_last->height,
GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->depth);
}
last_location.x,
last_location.y,
0, 0,
- GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->width,
- GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->height,
+ pixmap_last->width,
+ pixmap_last->height,
TRUE, FALSE);
- last_contents_size.x = GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->width;
- last_contents_size.y = GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->height;
- gdk_gc_set_clip_mask (cursor_gc, GDK_CURSOR_FB (last_cursor)->mask);
+ last_contents_size.x = pixmap_last->width;
+ last_contents_size.y = pixmap_last->height;
+
+ gdk_gc_set_clip_mask (cursor_gc, last_private->mask);
gdk_gc_set_clip_origin (cursor_gc,
- last_location.x + GDK_CURSOR_FB (last_cursor)->mask_off_x,
- last_location.y + GDK_CURSOR_FB (last_cursor)->mask_off_y);
+ last_location.x,
+ last_location.y);
gdk_fb_cursor_dc_reset ();
- gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL(gdk_parent_root),
+ gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL (gdk_parent_root),
cursor_gc,
- GDK_DRAWABLE_IMPL (GDK_CURSOR_FB (last_cursor)->cursor),
+ GDK_DRAWABLE_IMPL (last_private->cursor),
mydc,
0, 0,
last_location.x, last_location.y,
- GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->width,
- GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->height);
+ pixmap_last->width,
+ pixmap_last->height);
}
else
gdk_fb_cursor_invalidate ();
gdk_initialized = TRUE;
+ gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE);
+
return TRUE;
}
if (evmask & type_masks[type])
{
GdkEvent *event = gdk_event_new ();
-#if 0
- guint32 the_time = g_latest_time.tv_sec * 1000 + g_latest_time.tv_usec / 1000;
-#else
guint32 the_time;
-
the_time = gdk_fb_get_time ();
-#endif
event->any.type = type;
event->any.window = gdk_window_ref (window);
PangoRectangle *my_logical_rect, *my_ink_rect;
FT_Face ftf;
gboolean free_buffer = FALSE;
-
+
ftf = fbf->ftf;
pango_fb_font_set_size (font);
g_error ("Glyph render failed");
renderme = &bgy->bitmap;
+ pgi->top = bgy->top;
+ pgi->left = bgy->left;
free_buffer = TRUE;
}
else
my_logical_rect = &pgi->extents[1];
{
- my_ink_rect->width = (PANGO_SCALE * g->metrics.width) >> 6;
- my_ink_rect->height = (PANGO_SCALE * g->metrics.height) >> 6;
- my_ink_rect->x = - ((PANGO_SCALE * g->metrics.horiBearingX) >> 6);
- my_ink_rect->y = - ((PANGO_SCALE * g->metrics.horiBearingY) >> 6);
+ my_ink_rect->width = (PANGO_SCALE * g->metrics.width + 32) >> 6;
+ my_ink_rect->height = (PANGO_SCALE * g->metrics.height + 32) >> 6;
+ my_ink_rect->x = - ((PANGO_SCALE * g->metrics.horiBearingX + 32) >> 6);
+ my_ink_rect->y = - ((PANGO_SCALE * g->metrics.horiBearingY + 32) >> 6);
}
{
- my_logical_rect->width = (PANGO_SCALE * g->metrics.horiAdvance) >> 6;
- my_logical_rect->height = (PANGO_SCALE * ftf->size->metrics.height) >> 6;
- my_logical_rect->x = - ((PANGO_SCALE * g->metrics.horiBearingX) >> 6);
- my_logical_rect->y = - ((PANGO_SCALE * ftf->size->metrics.ascender) >> 6);
+ my_logical_rect->width = (PANGO_SCALE * g->metrics.horiAdvance + 32) >> 6;
+ my_logical_rect->height = (PANGO_SCALE * ftf->size->metrics.height + 32) >> 6;
+ my_logical_rect->x = - ((PANGO_SCALE * g->metrics.horiBearingX + 32) >> 6);
+ my_logical_rect->y = - ((PANGO_SCALE * ftf->size->metrics.ascender + 32) >> 6);
}
- pgi->hbearing = ((-g->metrics.horiBearingY) >> 6);
-
g_hash_table_insert (fbf->glyph_info, GUINT_TO_POINTER(glyph), pgi);
return pgi;
if (PANGO_FB_FONT (font)->desc.size != GPOINTER_TO_UINT (fbf->ftf->generic.data))
{
fbf->ftf->generic.data = GUINT_TO_POINTER (PANGO_FB_FONT (font)->desc.size);
- FT_Set_Char_Size (fbf->ftf, 0, (PANGO_FB_FONT (font)->desc.size << 6)/PANGO_SCALE, 72, 72);
+ FT_Set_Char_Size (fbf->ftf, 0, PANGO_PIXELS (PANGO_FB_FONT (font)->desc.size << 6), 72, 72);
}
}
if (metrics)
{
- metrics->ascent = ftf->size->metrics.ascender * PANGO_SCALE >> 6;
- metrics->descent = ftf->size->metrics.descender * PANGO_SCALE >> 6;
+ metrics->ascent = (ftf->size->metrics.ascender * PANGO_SCALE + 32) >> 6;
+ metrics->descent = (ftf->size->metrics.descender * PANGO_SCALE + 32) >> 6;
}
}
GdkCursor base;
GdkPixmap *cursor, *mask;
int hot_x, hot_y;
- int mask_off_x, mask_off_y;
} GdkCursorPrivateFB;
typedef struct {
/* Routines from gdkgeometry-fb.c */
void _gdk_window_init_position (GdkWindow *window);
+void _gdk_selection_window_destroyed (GdkWindow *window);
void _gdk_window_move_resize_child (GdkWindow *window,
gint x,
gint y,
typedef struct {
PangoRectangle extents[2];
GdkPixmapFBData fbd;
- int hbearing;
+ int top, left;
} PangoFBGlyphInfo;
GType pango_fb_font_get_type (void) G_GNUC_CONST;
GdkDrawableFBData *private = GDK_DRAWABLE_FBDATA (drawable);
int cur_x, cur_y;
- for (cur_y = start_y; cur_y*draw_direction < end_y*draw_direction; cur_y+=draw_direction)
+ if (draw_direction < 0)
{
- for (cur_x = start_x; cur_x < end_x; cur_x++)
+ int tmp;
+ tmp = start_y;
+ start_y = end_y;
+ end_y = tmp;
+ start_y--;
+ end_y--;
+
+ tmp = start_x;
+ start_x = end_x;
+ end_x = tmp;
+ start_x--;
+ end_x--;
+ }
+
+ for (cur_y = start_y; cur_y != end_y; cur_y+=draw_direction)
+ {
+ for (cur_x = start_x; cur_x != end_x; cur_x+=draw_direction)
{
GdkColor spot;
guchar *srcmem = src_private->mem;
int linelen = (end_x - start_x)*(depth>>3);
gint cur_y;
-
- for(cur_y = start_y; cur_y*draw_direction < end_y*draw_direction; cur_y += draw_direction)
+
+ if (draw_direction < 0)
+ {
+ int tmp;
+ tmp = start_y;
+ start_y = end_y;
+ end_y = tmp;
+ start_y--;
+ end_y--;
+ }
+
+ for(cur_y = start_y; cur_y != end_y; cur_y += draw_direction)
{
memmove (dc->mem + (cur_y * dc->rowstride) + start_x*(depth>>3),
srcmem + ((cur_y + src_y_off)*src_rowstride) + (start_x + src_x_off)*(depth>>3),
fg_r = fg.red >> 8;
fg_g = fg.green >> 8;
fg_b = fg.blue >> 8;
-
- for (y = start_y; y*draw_direction < end_y*draw_direction; y+=draw_direction)
+
+ if (draw_direction < 0)
+ {
+ int tmp;
+ tmp = start_y;
+ start_y = end_y;
+ end_y = tmp;
+ start_y--;
+ end_y--;
+
+ tmp = start_x;
+ start_x = end_x;
+ end_x = tmp;
+ start_x--;
+ end_x--;
+ }
+
+ for (y = start_y; y != end_y; y+=draw_direction)
{
- for (x = start_x; x < end_x; x++)
+ for (x = start_x; x != end_x; x+=draw_direction)
{
grayval = smem[x + src_x_off + (y + src_y_off) * src_rowstride];
break;
}
}
-
+
if (!gc_private->values.clip_mask &&
!gc_private->values.tile &&
!gc_private->values.stipple &&
#include "gdkprivate-fb.h"
+typedef struct _OwnerInfo OwnerInfo;
+
+struct _OwnerInfo
+{
+ GdkAtom selection;
+ GdkWindow *owner;
+};
+
+GSList *owner_list;
+
+/* When a window is destroyed we check if it is the owner
+ * of any selections. This is somewhat inefficient, but
+ * owner_list is typically short, and it is a low memory,
+ * low code solution
+ */
+void
+_gdk_selection_window_destroyed (GdkWindow *window)
+{
+ GSList *tmp_list = owner_list;
+ while (tmp_list)
+ {
+ OwnerInfo *info = tmp_list->data;
+ tmp_list = tmp_list->next;
+
+ if (info->owner == window)
+ {
+ owner_list = g_slist_remove (owner_list, info);
+ g_free (info);
+ }
+ }
+}
+
gint
gdk_selection_owner_set (GdkWindow *owner,
GdkAtom selection,
guint32 time,
gint send_event)
{
- return FALSE;
+ GSList *tmp_list;
+ OwnerInfo *info;
+
+ tmp_list = owner_list;
+ while (tmp_list)
+ {
+ info = tmp_list->data;
+ if (info->selection == selection)
+ {
+ owner_list = g_slist_remove (owner_list, info);
+ g_free (info);
+ break;
+ }
+ tmp_list = tmp_list->next;
+ }
+
+ if (owner)
+ {
+ info = g_new (OwnerInfo, 1);
+ info->owner = owner;
+ info->selection = selection;
+
+ owner_list = g_slist_prepend (owner_list, info);
+ }
+
+ return TRUE;
}
GdkWindow*
gdk_selection_owner_get (GdkAtom selection)
{
+ OwnerInfo *info;
+ GSList *tmp_list;
+
+ tmp_list = owner_list;
+ while (tmp_list)
+ {
+ info = tmp_list->data;
+ if (info->selection == selection)
+ {
+ return info->owner;
+ }
+ tmp_list = tmp_list->next;
+ }
return NULL;
}
GdkAtom target,
guint32 time)
{
+ GdkEvent *event;
+ GdkWindow *owner;
+
+ owner = gdk_selection_owner_get (selection);
+
+ if (owner)
+ {
+ event = gdk_event_make (owner, GDK_SELECTION_REQUEST, TRUE);
+ if (event)
+ {
+ event->selection.requestor = requestor;
+ event->selection.selection = selection;
+ event->selection.target = target;
+ event->selection.property = gdk_selection_property;
+ }
+ }
+ else
+ {
+ /* If no owner for the specified selection exists, the X server
+ * generates a SelectionNotify event to the requestor with property None.
+ */
+ gdk_selection_send_notify ((guint32)requestor,
+ selection,
+ target,
+ GDK_NONE,
+ 0);
+ }
}
gint
GdkAtom *ret_type,
gint *ret_format)
{
+ guchar *t = NULL;
+ GdkAtom prop_type;
+ gint prop_format;
+ gint prop_len;
+
g_return_val_if_fail (requestor != NULL, 0);
g_return_val_if_fail (GDK_IS_WINDOW (requestor), 0);
+
+ if (!gdk_property_get (requestor,
+ gdk_selection_property,
+ 0/*AnyPropertyType?*/,
+ 0, 0,
+ FALSE,
+ &prop_type, &prop_format, &prop_len,
+ &t))
+ {
+ *data = NULL;
+ return 0;
+ }
- return 0;
+ if (ret_type)
+ *ret_type = prop_type;
+ if (ret_format)
+ *ret_format = prop_format;
+
+ if (!gdk_property_get (requestor,
+ gdk_selection_property,
+ 0/*AnyPropertyType?*/,
+ 0, prop_len + 1,
+ FALSE,
+ &prop_type, &prop_format, &prop_len,
+ &t))
+ {
+ *data = NULL;
+ return 0;
+ }
+
+ *data = t;
+
+ return prop_len;
}
GdkAtom property,
guint32 time)
{
+ GdkEvent *event;
+
+ event = gdk_event_make (gdk_window_lookup (requestor), GDK_SELECTION_NOTIFY, TRUE);
+ if (event)
+ {
+ event->selection.selection = selection;
+ event->selection.target = target;
+ event->selection.property = property;
+ event->selection.requestor = (GdkNativeWindow) requestor;
+ }
}
gint
const guchar *text, gint length,
gchar ***list)
{
+ g_warning ("gdk_text_property_to_text_list() not implemented\n");
return 0;
}
gdk_free_text_list (gchar **list)
{
g_return_if_fail (list != NULL);
+ g_warning ("gdk_free_text_list() not implemented\n");
}
gint
GdkAtom *encoding, gint *format,
guchar **ctext, gint *length)
{
+ g_warning ("gdk_string_to_compound_text() not implemented\n");
return 0;
}
void gdk_free_compound_text (guchar *ctext)
{
+ g_warning ("gdk_free_compound_text() not implemented\n");
}
/**
gchar *
gdk_utf8_to_string_target (const gchar *str)
{
+ g_warning ("gdk_utf8_to_string_target() not implemented\n");
return 0;
}
guchar **ctext,
gint *length)
{
+ g_warning ("gdk_utf8_to_compound_text() not implemented\n");
return 0;
}
+static gint
+make_list (const gchar *text,
+ gint length,
+ gboolean latin1,
+ gchar ***list)
+{
+ GSList *strings = NULL;
+ gint n_strings = 0;
+ gint i;
+ const gchar *p = text;
+ const gchar *q;
+ GSList *tmp_list;
+ GError *error = NULL;
+
+ while (p < text + length)
+ {
+ gchar *str;
+
+ q = p;
+ while (*q && q < text + length)
+ q++;
+
+ if (latin1)
+ {
+ str = g_convert (p, q - p,
+ "UTF-8", "ISO-8859-1",
+ NULL, NULL, &error);
+
+ if (!str)
+ {
+ g_warning ("Error converting selection from STRING: %s",
+ error->message);
+ g_error_free (error);
+ }
+ }
+ else
+ str = g_strndup (p, q - p);
+
+ if (str)
+ {
+ strings = g_slist_prepend (strings, str);
+ n_strings++;
+ }
+
+ p = q + 1;
+ }
+
+ if (list)
+ *list = g_new (gchar *, n_strings + 1);
+
+ (*list)[n_strings] = NULL;
+
+ i = n_strings;
+ tmp_list = strings;
+ while (tmp_list)
+ {
+ if (list)
+ (*list)[--i] = tmp_list->data;
+ else
+ g_free (tmp_list->data);
+
+ tmp_list = tmp_list->next;
+ }
+
+ g_slist_free (strings);
+
+ return n_strings;
+}
+
+
/**
* gdk_text_property_to_utf8_list:
* @encoding: an atom representing the encoding of the text
gint length,
gchar ***list)
{
- return 0;
+ g_return_val_if_fail (text != NULL, 0);
+ g_return_val_if_fail (length >= 0, 0);
+
+ if (encoding == GDK_TARGET_STRING)
+ {
+ return make_list ((gchar *)text, length, TRUE, list);
+ }
+ else if (encoding == gdk_atom_intern ("UTF8_STRING", FALSE))
+ {
+ return make_list ((gchar *)text, length, FALSE, list);
+ }
+ else
+ {
+ gchar **local_list;
+ gint local_count;
+ gint i;
+ gchar *charset = NULL;
+ gboolean need_conversion = !g_get_charset (&charset);
+ gint count = 0;
+ GError *error = NULL;
+
+ /* Probably COMPOUND text, we fall back to Xlib routines
+ */
+ local_count = gdk_text_property_to_text_list (encoding,
+ format,
+ text,
+ length,
+ &local_list);
+ if (list)
+ *list = g_new (gchar *, local_count + 1);
+
+ for (i=0; i<local_count; i++)
+ {
+ /* list contains stuff in our default encoding
+ */
+ if (need_conversion)
+ {
+ gchar *utf = g_convert (local_list[i], -1,
+ "UTF-8", charset,
+ NULL, NULL, &error);
+ if (utf)
+ {
+ if (list)
+ (*list)[count++] = utf;
+ else
+ g_free (utf);
+ }
+ else
+ {
+ g_warning ("Error converting to UTF-8 from '%s': %s",
+ charset, error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+ }
+ else
+ {
+ if (list)
+ (*list)[count++] = g_strdup (local_list[i]);
+ }
+ }
+
+ gdk_free_text_list (local_list);
+ (*list)[count] = NULL;
+
+ return count;
+ }
}
GdkCursor *cursor;
GdkWindowObject *private;
- cursor = gdk_cursor_new (GDK_LEFT_PTR);
-
attr.width = gdk_screen_width ();
attr.height = gdk_screen_height ();
attr.window_type = GDK_WINDOW_ROOT;
- attr.cursor = cursor;
+ attr.cursor = NULL;
attr.event_mask = GDK_EXPOSURE_MASK;
attr.wclass = GDK_INPUT_OUTPUT;
gdk_parent_root = gdk_window_new (NULL, &attr, GDK_WA_CURSOR);
GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->lim_y = attr.height;
_gdk_fb_screen_gc = gdk_gc_new (gdk_parent_root);
-
+
gdk_fb_drawable_clear (gdk_parent_root);
+
+ /* Must be done after root is created, since gdk_cursor_new()
+ * references gdk_parent_root.
+ */
+ cursor = gdk_cursor_new (GDK_LEFT_PTR);
+ gdk_window_set_cursor (gdk_parent_root, cursor);
}
GdkWindow*
gboolean recursing,
gboolean foreign_destroy)
{
+ _gdk_selection_window_destroyed (window);
+
#if 0
GdkWindowObject *private;
GdkWindowObject *temp_private;
recompute_abs_positions (drawable, 0, 0, 0, 0, INT_MAX, INT_MAX);
}
-/* You can thank g_list_insert_sorted and GCompareFunc for these */
-static gint static_dx_hack, static_dy_hack;
-
-static gint
-compare_draw_rects (gconstpointer a, gconstpointer b)
-{
- const GdkRegionBox *ba = a, *bb = b;
-
- if (static_dy_hack > 0 && ba->y1 < bb->y1)
- return 1;
- if (static_dy_hack < 0 && ba->y1 > bb->y1)
- return 1;
- if (static_dx_hack > 0 && ba->x1 < bb->x1)
- return 1;
- if (static_dx_hack < 0 && ba->x1 > bb->x1)
- return 1;
-
- return -1;
-}
-
void
gdk_fb_window_move_resize (GdkWindow *window,
gint x,
{
GdkWindowObject *private;
gint dx, dy, dw, dh;
+ gint i, draw_dir;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
if (send_expose_events)
{
GdkRegion *new_region, *region;
- int i;
gboolean handle_cursor = FALSE;
- GList *rects, *ltmp, *next;
new_region = gdk_fb_clip_region (GDK_DRAWABLE_IMPL (window), NULL, TRUE, FALSE);
}
gdk_fb_drawing_context_init (&fbdc, GDK_DRAWABLE_IMPL (gdk_parent_root), NULL, FALSE, FALSE);
- g_print ("[%p] %ld rect +[%d, %d] move [%d, %d] from [%d, %d] to [%d, %d]\n",
- window,
- region->numRects,
- region->rects[0].x2 - region->rects[0].x1,
- region->rects[0].y2 - region->rects[0].y1,
- dx, dy,
- region->rects[0].x1 - dx,
- region->rects[0].y1 - dy,
- region->rects[0].x1,
- region->rects[0].y1);
- static_dx_hack = dx;
- static_dy_hack = dy;
-
- for (rects = NULL, i = 0; i < region->numRects; i++)
- rects = g_list_insert_sorted (rects, ®ion->rects[i], compare_draw_rects);
-
- for (ltmp = rects; ltmp; ltmp = next)
+ draw_dir = 1;
+ if ((dy>0) || ((dy==0) && (dx>0)))
+ draw_dir = -1;
+
+ for (i=(draw_dir>0)?0:region->numRects-1;i >= 0 && i < region->numRects; i+=draw_dir)
{
- GdkRegionBox *reg = ltmp->data;
+ GdkRegionBox *reg = ®ion->rects[i];
gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL(gdk_parent_root),
_gdk_fb_screen_gc,
(reg->y1),
(reg->x2 - reg->x1),
(reg->y2 - reg->y1));
- next = ltmp->next;
- g_list_free_1 (ltmp);
}
gdk_fb_drawing_context_finalize (&fbdc);
}
gdk_region_subtract (new_region, region);
gdk_region_destroy (region);
-#if 0
- g_print("Redraw region enclosed by [%d, %d] +[%d, %d]\n",
- new_region->extents.x1, new_region->extents.y1,
- new_region->extents.x2 - new_region->extents.x1,
- new_region->extents.y2 - new_region->extents.y1);
-#endif
-
gdk_window_invalidate_region_clear (gdk_parent_root, new_region);
if (handle_cursor)
gdk_fb_cursor_unhide ();
#include "x11/gdkx.h" /* For gdk_window_lookup() */
#elif defined (GDK_WINDOWING_WIN32)
#include "win32/gdkwin32.h" /* For gdk_window_lookup() */
+#elif defined (GDK_WINDOWING_FB)
+#include "linux-fb/gdkfb.h" /* For gdk_window_lookup() */
#elif defined (GDK_WINDOWING_NANOX)
#include "nanox/gdkprivate-nanox.h" /* For gdk_window_lookup() */
#endif
/* Create GdkWindow structure for the requestor */
-#if defined(GDK_WINDOWING_WIN32) || defined(GDK_WINDOWING_X11)
+#if defined(GDK_WINDOWING_WIN32) || defined(GDK_WINDOWING_X11) || defined(GDK_WINDOWING_FB)
info->requestor = gdk_window_lookup (event->requestor);
if (!info->requestor)
info->requestor = gdk_window_foreign_new (event->requestor);